package action;

import java.util.Map;

import model.EstpInfo;
import model.User;
import action.base.BaseAction;
import java.util.List;
import com.opensymphony.xwork2.ActionContext;

public class SelfGetEstpInfo extends BaseAction {
	private User user;
	private EstpInfo itemEstp;
	public EstpInfo getItemEstp() {
		return itemEstp;
	}
	public void setItemEstp(EstpInfo itemEstp) {
		this.itemEstp = itemEstp;
	}
	public String execute() throws Exception{
		//根据user查询申请人信息
			ActionContext ctx = ActionContext.getContext();
			user = (User)ctx.getSession().get("USER");
			List<EstpInfo> ei = mge.getEstpByUser(user);
			if(ei.size()>0){
				EstpInfo e = (EstpInfo)ei.get(0);
				setItemEstp(e);
				ctx.getSession().put("E", e);
				return "input";
			}else{
				return "input";
			}
		
	}
}
